home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH4 / 4-2-5.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  1.6 KB  |  61 lines

  1. VERSION 5.00
  2. Begin VB.Form frm4_2_5 
  3.    Caption         =   "4-2-5"
  4.    ClientHeight    =   1320
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   2550
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1320
  20.    ScaleWidth      =   2550
  21.    Begin VB.PictureBox picResults 
  22.       Height          =   495
  23.       Left            =   240
  24.       ScaleHeight     =   435
  25.       ScaleWidth      =   1995
  26.       TabIndex        =   1
  27.       Top             =   720
  28.       Width           =   2055
  29.    End
  30.    Begin VB.CommandButton cmdDisplay 
  31.       Caption         =   "Display Numbers"
  32.       Height          =   495
  33.       Left            =   360
  34.       TabIndex        =   0
  35.       Top             =   120
  36.       Width           =   1815
  37.    End
  38. Attribute VB_Name = "frm4_2_5"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdDisplay_Click()
  44.   Dim x As Single
  45.   'Demonstrate the local nature of variables
  46.   picResults.Cls
  47.   x = 2
  48.   picResults.Print x;
  49.   Call Trivial
  50.   picResults.Print x;
  51.   Call Trivial
  52.   picResults.Print x;
  53. End Sub
  54. Private Sub Trivial()
  55.   Dim x As Single
  56.   'Do something trivial
  57.   picResults.Print x;
  58.   x = 3
  59.   picResults.Print x;
  60. End Sub
  61.